unit BrandUnit;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Grids, DBGrids, DB, ADODB, StdCtrls;

type
  TfrmBrand = class(TForm)
    Query: TADOQuery;
    DBGrid1: TDBGrid;
    btnSave: TButton;
    DataSource1: TDataSource;
    QueryBrandId: TAutoIncField;
    QueryBrandCompany: TWideStringField;
    QueryBrandUrl: TWideStringField;
    QueryBrandEmail: TWideStringField;
    QueryBrandAddr: TWideStringField;
    QueryBrandTradeTelephone: TWideStringField;
    QueryBrandServiceTelephone: TWideStringField;
    QueryBrandTechnicTelephone: TWideStringField;
    QueryBrandTradeQQ: TWideStringField;
    QueryBrandServiceQQ: TWideStringField;
    QueryBrandTechnicQQ: TWideStringField;
    QueryBrandStyle: TIntegerField;
    QueryUpdateTime: TDateTimeField;
    QueryBrandName: TStringField;
    QueryBrandUpgradeUrl: TStringField;
    QueryBrandVersion: TStringField;
    QueryDownLimit: TIntegerField;
    procedure FormCreate(Sender: TObject);
    procedure btnSaveClick(Sender: TObject);
    procedure QueryBeforePost(DataSet: TDataSet);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frmBrand: TfrmBrand;

implementation

uses FunctionUnit, GTMain;

{$R *.dfm}

procedure TfrmBrand.FormCreate(Sender: TObject);
begin
  OpenDataSet('SELECT * FROM Brand', Query, Database);
end;

procedure TfrmBrand.btnSaveClick(Sender: TObject);
begin
  Query.CheckBrowseMode;
end;

procedure TfrmBrand.QueryBeforePost(DataSet: TDataSet);
begin
  Query.FieldByName('BrandStyle').Value := 2;
end;

end.
      